/**
 * FormPrinc.java
 * Copyright (C) 2009 Jose Mauro da Silva Sandy
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 */

/*
 * FormPrinc.java
 *
 * Created on 05/05/2009, 21:22:22
 */

package frames;

import javax.swing.JOptionPane;
import utils.ErrorMessage;
import utils.ThreadShowDate;

/**
 *
 * @author jmsandy
 */
public class FormPrinc extends javax.swing.JFrame {

    /** Creates new form FormPrinc */
    public FormPrinc() {
        initComponents();
        initializeThread();
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        toolBar = new javax.swing.JToolBar();
        btnOrcamento = new javax.swing.JButton();
        btnProduto = new javax.swing.JButton();
        btnEmpreendimento = new javax.swing.JButton();
        btnNotaDespesa = new javax.swing.JButton();
        btnNotaCompra = new javax.swing.JButton();
        jPanelRodape = new javax.swing.JPanel();
        lbData = new javax.swing.JLabel();
        jMenuPrinc = new javax.swing.JMenuBar();
        jMenuRelatorios = new javax.swing.JMenu();
        jMenuItemRelEm = new javax.swing.JMenuItem();
        jMenuItemComForn = new javax.swing.JMenuItem();
        jMenuItemQtdeProd = new javax.swing.JMenuItem();
        jMenuItemCompProd = new javax.swing.JMenuItem();
        jSeparatorProdutos = new javax.swing.JSeparator();
        jMenuItemDivLucros = new javax.swing.JMenuItem();
        jMenuCadastros = new javax.swing.JMenu();
        jMenuDespesa = new javax.swing.JMenuItem();
        jMenuEtapas = new javax.swing.JMenuItem();
        jSeparatorGrupo = new javax.swing.JSeparator();
        jMenuItemGrupo = new javax.swing.JMenuItem();
        jMenuItemUnidade = new javax.swing.JMenuItem();
        jMenuItemProduto = new javax.swing.JMenuItem();
        jSeparatorPessoas = new javax.swing.JSeparator();
        jMenuItemFornecedor = new javax.swing.JMenuItem();
        jMenuItemInvestidor = new javax.swing.JMenuItem();
        jMenuItemEmp = new javax.swing.JMenuItem();
        jMenuMovimentos = new javax.swing.JMenu();
        jMenuItemOrcamento = new javax.swing.JMenuItem();
        jSeparatorOrcamento = new javax.swing.JSeparator();
        jMenuNotas = new javax.swing.JMenu();
        jMenuItemDespesa = new javax.swing.JMenuItem();
        jMenuItemNotaCompra = new javax.swing.JMenuItem();
        jMenuItemFinalizarEmp = new javax.swing.JMenuItem();
        jSeparatorEstorno = new javax.swing.JSeparator();
        jMenuEstorno = new javax.swing.JMenu();
        jMenuItemEstEmp = new javax.swing.JMenuItem();
        jMenuItemEstVenda = new javax.swing.JMenuItem();
        jSeparatorVendas = new javax.swing.JSeparator();
        jMenuItemVendas = new javax.swing.JMenuItem();
        jMenuTabelas = new javax.swing.JMenu();
        jMenuItemInvEmp = new javax.swing.JMenuItem();
        jMenuUtilitarios = new javax.swing.JMenu();
        jMenuItemConfigBd = new javax.swing.JMenuItem();
        jMenuSobre = new javax.swing.JMenu();
        jMenuSair = new javax.swing.JMenu();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        setTitle("Sistema Gerenciador de Gastos de Construção Civil");

        toolBar.setFont(new java.awt.Font("SansSerif", 0, 12));

        btnOrcamento.setFont(new java.awt.Font("SansSerif", 0, 12));
        btnOrcamento.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/orc.png"))); // NOI18N
        btnOrcamento.setToolTipText("Orçamento");
        btnOrcamento.setFocusable(false);
        btnOrcamento.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        btnOrcamento.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
        btnOrcamento.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                btnOrcamentoMouseClicked(evt);
            }
        });
        toolBar.add(btnOrcamento);

        btnProduto.setFont(new java.awt.Font("SansSerif", 0, 12));
        btnProduto.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/prod.png"))); // NOI18N
        btnProduto.setToolTipText("Produto");
        btnProduto.setFocusable(false);
        btnProduto.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        btnProduto.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
        btnProduto.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                btnProdutoMouseClicked(evt);
            }
        });
        toolBar.add(btnProduto);

        btnEmpreendimento.setFont(new java.awt.Font("SansSerif", 0, 12));
        btnEmpreendimento.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/emp.png"))); // NOI18N
        btnEmpreendimento.setToolTipText("Empreendimento");
        btnEmpreendimento.setFocusable(false);
        btnEmpreendimento.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        btnEmpreendimento.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
        btnEmpreendimento.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                btnEmpreendimentoMouseClicked(evt);
            }
        });
        toolBar.add(btnEmpreendimento);

        btnNotaDespesa.setFont(new java.awt.Font("SansSerif", 0, 12));
        btnNotaDespesa.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/nfDesp.png"))); // NOI18N
        btnNotaDespesa.setToolTipText("Nota de Despesa");
        btnNotaDespesa.setFocusable(false);
        btnNotaDespesa.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        btnNotaDespesa.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
        btnNotaDespesa.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                btnNotaDespesaMouseClicked(evt);
            }
        });
        toolBar.add(btnNotaDespesa);

        btnNotaCompra.setFont(new java.awt.Font("SansSerif", 0, 12));
        btnNotaCompra.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/nfComp.png"))); // NOI18N
        btnNotaCompra.setToolTipText("Nota de Compra");
        btnNotaCompra.setFocusable(false);
        btnNotaCompra.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        btnNotaCompra.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
        btnNotaCompra.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                btnNotaCompraMouseClicked(evt);
            }
        });
        toolBar.add(btnNotaCompra);

        jPanelRodape.setBorder(javax.swing.BorderFactory.createEtchedBorder());

        lbData.setFont(new java.awt.Font("Monospaced", 1, 12));
        lbData.setText("Seg 11/07/2009  99:99:99");

        javax.swing.GroupLayout jPanelRodapeLayout = new javax.swing.GroupLayout(jPanelRodape);
        jPanelRodape.setLayout(jPanelRodapeLayout);
        jPanelRodapeLayout.setHorizontalGroup(
            jPanelRodapeLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanelRodapeLayout.createSequentialGroup()
                .addContainerGap(576, Short.MAX_VALUE)
                .addComponent(lbData)
                .addContainerGap())
        );
        jPanelRodapeLayout.setVerticalGroup(
            jPanelRodapeLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(lbData)
        );

        jMenuPrinc.setFont(new java.awt.Font("SansSerif", 0, 12));

        jMenuRelatorios.setText("Relatórios");
        jMenuRelatorios.setFont(new java.awt.Font("SansSerif", 0, 12));

        jMenuItemRelEm.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_E, java.awt.event.InputEvent.ALT_MASK));
        jMenuItemRelEm.setFont(new java.awt.Font("SansSerif", 0, 12));
        jMenuItemRelEm.setText("Empreendimento");
        jMenuItemRelEm.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuItemRelEmActionPerformed(evt);
            }
        });
        jMenuRelatorios.add(jMenuItemRelEm);

        jMenuItemComForn.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_C, java.awt.event.InputEvent.ALT_MASK));
        jMenuItemComForn.setFont(new java.awt.Font("SansSerif", 0, 12));
        jMenuItemComForn.setText("Compras por Fornecedor");
        jMenuItemComForn.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuItemComFornActionPerformed(evt);
            }
        });
        jMenuRelatorios.add(jMenuItemComForn);

        jMenuItemQtdeProd.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_Q, java.awt.event.InputEvent.ALT_MASK));
        jMenuItemQtdeProd.setFont(new java.awt.Font("SansSerif", 0, 12));
        jMenuItemQtdeProd.setText("Quantitativo por Produto");
        jMenuItemQtdeProd.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuItemQtdeProdActionPerformed(evt);
            }
        });
        jMenuRelatorios.add(jMenuItemQtdeProd);

        jMenuItemCompProd.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_P, java.awt.event.InputEvent.ALT_MASK));
        jMenuItemCompProd.setFont(new java.awt.Font("SansSerif", 0, 12));
        jMenuItemCompProd.setText("Comparativo por Produto");
        jMenuItemCompProd.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuItemCompProdActionPerformed(evt);
            }
        });
        jMenuRelatorios.add(jMenuItemCompProd);
        jMenuRelatorios.add(jSeparatorProdutos);

        jMenuItemDivLucros.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_D, java.awt.event.InputEvent.ALT_MASK));
        jMenuItemDivLucros.setFont(new java.awt.Font("SansSerif", 0, 12));
        jMenuItemDivLucros.setText("Divisão de Lucros");
        jMenuItemDivLucros.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuItemDivLucrosActionPerformed(evt);
            }
        });
        jMenuRelatorios.add(jMenuItemDivLucros);

        jMenuPrinc.add(jMenuRelatorios);

        jMenuCadastros.setText("Cadastros");
        jMenuCadastros.setFont(new java.awt.Font("SansSerif", 0, 12));

        jMenuDespesa.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_D, java.awt.event.InputEvent.ALT_MASK));
        jMenuDespesa.setFont(new java.awt.Font("SansSerif", 0, 12));
        jMenuDespesa.setText("Despesa");
        jMenuDespesa.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuDespesaActionPerformed(evt);
            }
        });
        jMenuCadastros.add(jMenuDespesa);

        jMenuEtapas.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_E, java.awt.event.InputEvent.ALT_MASK));
        jMenuEtapas.setFont(new java.awt.Font("SansSerif", 0, 12));
        jMenuEtapas.setText("Etapa");
        jMenuEtapas.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuEtapasActionPerformed(evt);
            }
        });
        jMenuCadastros.add(jMenuEtapas);
        jMenuCadastros.add(jSeparatorGrupo);

        jMenuItemGrupo.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_G, java.awt.event.InputEvent.ALT_MASK));
        jMenuItemGrupo.setFont(new java.awt.Font("SansSerif", 0, 12));
        jMenuItemGrupo.setText("Grupo");
        jMenuItemGrupo.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuItemGrupoActionPerformed(evt);
            }
        });
        jMenuCadastros.add(jMenuItemGrupo);

        jMenuItemUnidade.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_U, java.awt.event.InputEvent.ALT_MASK));
        jMenuItemUnidade.setFont(new java.awt.Font("SansSerif", 0, 12));
        jMenuItemUnidade.setText("Unidade");
        jMenuItemUnidade.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuItemUnidadeActionPerformed(evt);
            }
        });
        jMenuCadastros.add(jMenuItemUnidade);

        jMenuItemProduto.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_P, java.awt.event.InputEvent.ALT_MASK));
        jMenuItemProduto.setFont(new java.awt.Font("SansSerif", 0, 12));
        jMenuItemProduto.setText("Produto");
        jMenuItemProduto.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuItemProdutoActionPerformed(evt);
            }
        });
        jMenuCadastros.add(jMenuItemProduto);

        jSeparatorPessoas.setFont(new java.awt.Font("SansSerif", 0, 12));
        jMenuCadastros.add(jSeparatorPessoas);

        jMenuItemFornecedor.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_F, java.awt.event.InputEvent.ALT_MASK));
        jMenuItemFornecedor.setFont(new java.awt.Font("SansSerif", 0, 12));
        jMenuItemFornecedor.setText("Fornecedor");
        jMenuItemFornecedor.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuItemFornecedorActionPerformed(evt);
            }
        });
        jMenuCadastros.add(jMenuItemFornecedor);

        jMenuItemInvestidor.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_I, java.awt.event.InputEvent.ALT_MASK));
        jMenuItemInvestidor.setFont(new java.awt.Font("SansSerif", 0, 12));
        jMenuItemInvestidor.setText("Investidor");
        jMenuItemInvestidor.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuItemInvestidorActionPerformed(evt);
            }
        });
        jMenuCadastros.add(jMenuItemInvestidor);

        jMenuItemEmp.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_M, java.awt.event.InputEvent.ALT_MASK));
        jMenuItemEmp.setFont(new java.awt.Font("SansSerif", 0, 12));
        jMenuItemEmp.setText("Empreendimento");
        jMenuItemEmp.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuItemEmpActionPerformed(evt);
            }
        });
        jMenuCadastros.add(jMenuItemEmp);

        jMenuPrinc.add(jMenuCadastros);

        jMenuMovimentos.setText("Movimentos");
        jMenuMovimentos.setFont(new java.awt.Font("SansSerif", 0, 12));

        jMenuItemOrcamento.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_O, java.awt.event.InputEvent.ALT_MASK));
        jMenuItemOrcamento.setFont(new java.awt.Font("SansSerif", 0, 12));
        jMenuItemOrcamento.setText("Orçamento");
        jMenuItemOrcamento.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuItemOrcamentoActionPerformed(evt);
            }
        });
        jMenuMovimentos.add(jMenuItemOrcamento);
        jMenuMovimentos.add(jSeparatorOrcamento);

        jMenuNotas.setText("Notas");
        jMenuNotas.setFont(new java.awt.Font("SansSerif", 0, 12));

        jMenuItemDespesa.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_D, java.awt.event.InputEvent.ALT_MASK));
        jMenuItemDespesa.setFont(new java.awt.Font("SansSerif", 0, 12));
        jMenuItemDespesa.setText("Notas de Despesa");
        jMenuItemDespesa.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuItemDespesaActionPerformed(evt);
            }
        });
        jMenuNotas.add(jMenuItemDespesa);

        jMenuItemNotaCompra.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_C, java.awt.event.InputEvent.ALT_MASK));
        jMenuItemNotaCompra.setFont(new java.awt.Font("SansSerif", 0, 12));
        jMenuItemNotaCompra.setText("Notas de Compra");
        jMenuItemNotaCompra.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuItemNotaCompraActionPerformed(evt);
            }
        });
        jMenuNotas.add(jMenuItemNotaCompra);

        jMenuMovimentos.add(jMenuNotas);

        jMenuItemFinalizarEmp.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_F, java.awt.event.InputEvent.ALT_MASK));
        jMenuItemFinalizarEmp.setFont(new java.awt.Font("SansSerif", 0, 12));
        jMenuItemFinalizarEmp.setText("Finalizar Empreendimento");
        jMenuItemFinalizarEmp.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuItemFinalizarEmpActionPerformed(evt);
            }
        });
        jMenuMovimentos.add(jMenuItemFinalizarEmp);
        jMenuMovimentos.add(jSeparatorEstorno);

        jMenuEstorno.setText("Estorno");
        jMenuEstorno.setFont(new java.awt.Font("SansSerif", 0, 12));

        jMenuItemEstEmp.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_E, java.awt.event.InputEvent.ALT_MASK));
        jMenuItemEstEmp.setFont(new java.awt.Font("SansSerif", 0, 12));
        jMenuItemEstEmp.setText("Finalização Empreendimento");
        jMenuItemEstEmp.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuItemEstEmpActionPerformed(evt);
            }
        });
        jMenuEstorno.add(jMenuItemEstEmp);

        jMenuItemEstVenda.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_V, java.awt.event.InputEvent.ALT_MASK));
        jMenuItemEstVenda.setFont(new java.awt.Font("SansSerif", 0, 12));
        jMenuItemEstVenda.setText("Vendas e Divisão de Lucros");
        jMenuItemEstVenda.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuItemEstVendaActionPerformed(evt);
            }
        });
        jMenuEstorno.add(jMenuItemEstVenda);

        jMenuMovimentos.add(jMenuEstorno);
        jMenuMovimentos.add(jSeparatorVendas);

        jMenuItemVendas.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_V, java.awt.event.InputEvent.ALT_MASK));
        jMenuItemVendas.setFont(new java.awt.Font("SansSerif", 0, 12));
        jMenuItemVendas.setText("Vendas e Divisão de Lucros");
        jMenuItemVendas.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuItemVendasActionPerformed(evt);
            }
        });
        jMenuMovimentos.add(jMenuItemVendas);

        jMenuPrinc.add(jMenuMovimentos);

        jMenuTabelas.setText("Tabelas");
        jMenuTabelas.setFont(new java.awt.Font("SansSerif", 0, 12));

        jMenuItemInvEmp.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_I, java.awt.event.InputEvent.ALT_MASK));
        jMenuItemInvEmp.setFont(new java.awt.Font("SansSerif", 0, 12));
        jMenuItemInvEmp.setText("Relacionar Investidor à Empreendimento");
        jMenuItemInvEmp.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuItemInvEmpActionPerformed(evt);
            }
        });
        jMenuTabelas.add(jMenuItemInvEmp);

        jMenuPrinc.add(jMenuTabelas);

        jMenuUtilitarios.setText("Utilitários");
        jMenuUtilitarios.setFont(new java.awt.Font("SansSerif", 0, 12)); // NOI18N

        jMenuItemConfigBd.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_C, java.awt.event.InputEvent.ALT_MASK));
        jMenuItemConfigBd.setFont(new java.awt.Font("SansSerif", 0, 12)); // NOI18N
        jMenuItemConfigBd.setText("Configuração do Banco de Dados");
        jMenuItemConfigBd.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuItemConfigBdActionPerformed(evt);
            }
        });
        jMenuUtilitarios.add(jMenuItemConfigBd);

        jMenuPrinc.add(jMenuUtilitarios);

        jMenuSobre.setText("Sobre");
        jMenuSobre.setFont(new java.awt.Font("SansSerif", 0, 12)); // NOI18N
        jMenuSobre.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mousePressed(java.awt.event.MouseEvent evt) {
                jMenuSobreMousePressed(evt);
            }
        });
        jMenuPrinc.add(jMenuSobre);

        jMenuSair.setText("Sair");
        jMenuSair.setFont(new java.awt.Font("SansSerif", 0, 12));
        jMenuSair.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mousePressed(java.awt.event.MouseEvent evt) {
                jMenuSairMousePressed(evt);
            }
        });
        jMenuPrinc.add(jMenuSair);

        setJMenuBar(jMenuPrinc);

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(toolBar, javax.swing.GroupLayout.DEFAULT_SIZE, 760, Short.MAX_VALUE)
            .addComponent(jPanelRodape, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addComponent(toolBar, javax.swing.GroupLayout.PREFERRED_SIZE, 34, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 451, Short.MAX_VALUE)
                .addComponent(jPanelRodape, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
        );

        java.awt.Dimension screenSize = java.awt.Toolkit.getDefaultToolkit().getScreenSize();
        setBounds((screenSize.width-764)/2, (screenSize.height-547)/2, 764, 547);
    }// </editor-fold>//GEN-END:initComponents

    //<editor-fold defaultstate="collapsed" desc="FORMULARIOS CADASTRO">
    // Realiza a chamada ao metodo responsavel para exibicao do form de despesa
    private void jMenuDespesaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuDespesaActionPerformed
        // Chamada ao formulario de despesas
        FormDespesa form = new FormDespesa();
        form.setVisible(true);
        form.dispose();
    }//GEN-LAST:event_jMenuDespesaActionPerformed
    // Realiza a chamada ao metodo responsavel para exibicao do form de etapas
    private void jMenuEtapasActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuEtapasActionPerformed
        FormEtapa form = new FormEtapa();
        form.setModal(true);
        form.setVisible(true);
        form.dispose();
    }//GEN-LAST:event_jMenuEtapasActionPerformed
    // Realiza a chamada ao metodo responsavel para exibicao do form de grupos
    private void jMenuItemGrupoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItemGrupoActionPerformed
        FormGrupo form = new FormGrupo(FormGrupo.K_FORM_CADASTRO);
        form.setModal(true);
        form.setVisible(true);
        form.dispose();
    }//GEN-LAST:event_jMenuItemGrupoActionPerformed
    // Realiza a chamada ao metodo responsavel para exibicao do form de unidades
    private void jMenuItemUnidadeActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItemUnidadeActionPerformed
        FormUnidade form = new FormUnidade();
        form.setModal(true);
        form.setVisible(true);
        form.dispose();
    }//GEN-LAST:event_jMenuItemUnidadeActionPerformed
    // Realiza a chamada ao metodo responsavel para exibicao do form de produto
    private void jMenuItemProdutoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItemProdutoActionPerformed
        FormProduto form = new FormProduto();
        form.setModal(true);
        form.setVisible(true);
        form.dispose();
    }//GEN-LAST:event_jMenuItemProdutoActionPerformed
    // Realiza a chamada ao metodo responsavel para exibicao do form fornecedor
    private void jMenuItemFornecedorActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItemFornecedorActionPerformed
        FormFornecedor form = new FormFornecedor();
        form.setModal(true);
        form.setVisible(true);
        form.dispose();
    }//GEN-LAST:event_jMenuItemFornecedorActionPerformed
    // Realiza a chamada ao metodo responsavel para exibicao do form investidor
    private void jMenuItemInvestidorActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItemInvestidorActionPerformed
        FormInvestidor form = new FormInvestidor();
        form.setModal(true);
        form.setVisible(true);
        form.dispose();
    }//GEN-LAST:event_jMenuItemInvestidorActionPerformed
    // Realiza a chamada ao metodo responsavel para exibicao do form empreendimento
    private void jMenuItemEmpActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItemEmpActionPerformed
        FormEmpreendimento form = new FormEmpreendimento();
        form.setModal(true);
        form.setVisible(true);
        form.dispose();
    }//GEN-LAST:event_jMenuItemEmpActionPerformed
    //</editor-fold>

    //<editor-fold defaultstate="collapsed" desc="FORMULARIOS TABELA">
    // Realiza a chamada ao metodo responsavel para exibicao do form de inv_emp
    private void jMenuItemInvEmpActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItemInvEmpActionPerformed
        try{
            FormInvEmp form = new FormInvEmp();
            form.setModal(true);
            form.setVisible(true);
            form.dispose();
        }
        catch(Exception ex){
            JOptionPane.showMessageDialog(this, ErrorMessage.MSG_GERAL_BANCO +
              "\n" + ErrorMessage.MSG_GERAL_LOG, "", JOptionPane.ERROR_MESSAGE);
        }
    }//GEN-LAST:event_jMenuItemInvEmpActionPerformed
    //</editor-fold>
    
    //<editor-fold defaultstate="collapsed" desc="FORMULARIOS MOVIMENTOS">
    // Realiza a chamada ao metodo responsavel para exibicao do form de Orcamento
    private void jMenuItemOrcamentoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItemOrcamentoActionPerformed
        FormOrcamento form = new FormOrcamento();
        form.setModal(true);
        form.setVisible(true);
        form.dispose();
    }//GEN-LAST:event_jMenuItemOrcamentoActionPerformed
    // Relatorio de empreendimento
    private void jMenuItemRelEmActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItemRelEmActionPerformed
        FormRelEmp form = new FormRelEmp();
        form.setModal(true);
        form.setVisible(true);
        form.dispose();
    }//GEN-LAST:event_jMenuItemRelEmActionPerformed
    // Formulario de notas de despesas
    private void jMenuItemDespesaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItemDespesaActionPerformed
        try{
            FormNotaDespesa form = new FormNotaDespesa();
            form.setModal(true);
            form.setVisible(true);
            form.dispose();
        }
        catch(Exception ex){
            JOptionPane.showMessageDialog(this, ErrorMessage.MSG_GERAL_BANCO +
              "\n" + ErrorMessage.MSG_GERAL_LOG, "", JOptionPane.ERROR_MESSAGE);
        }
    }//GEN-LAST:event_jMenuItemDespesaActionPerformed
    // Fecha o formulario Principal    // Toolbar evento Orcamento
    private void btnOrcamentoMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_btnOrcamentoMouseClicked
        FormOrcamento form = new FormOrcamento();
        form.setModal(true);
        form.setVisible(true);
        form.dispose();
}//GEN-LAST:event_btnOrcamentoMouseClicked
    // Toolbar evento Nota de Despesa
    private void btnNotaDespesaMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_btnNotaDespesaMouseClicked
        try{
            FormNotaDespesa form = new FormNotaDespesa();
            form.setModal(true);
            form.setVisible(true);
            form.dispose();
        }
        catch(Exception ex){
            JOptionPane.showMessageDialog(this, ErrorMessage.MSG_GERAL_BANCO +
              "\n" + ErrorMessage.MSG_GERAL_LOG, "", JOptionPane.ERROR_MESSAGE);
        }
    }//GEN-LAST:event_btnNotaDespesaMouseClicked
    // Toolbar evento Nota de Compra
    private void btnNotaCompraMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_btnNotaCompraMouseClicked
        try{
            FormNotaCompra form = new FormNotaCompra();
            form.setModal(true);
            form.setVisible(true);
            form.dispose();
        }
        catch(Exception ex){
            JOptionPane.showMessageDialog(this, ErrorMessage.MSG_GERAL_BANCO +
              "\n" + ErrorMessage.MSG_GERAL_LOG, "", JOptionPane.ERROR_MESSAGE);
        }
    }//GEN-LAST:event_btnNotaCompraMouseClicked
    // Toolbar evento Produto
    private void btnProdutoMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_btnProdutoMouseClicked
        FormProduto form = new FormProduto();
        form.setModal(true);
        form.setVisible(true);
        form.dispose();
    }//GEN-LAST:event_btnProdutoMouseClicked
    // Toolbar evento Empreendimento
    private void btnEmpreendimentoMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_btnEmpreendimentoMouseClicked
        FormEmpreendimento form = new FormEmpreendimento();
        form.setModal(true);
        form.setVisible(true);
        form.dispose();
    }//GEN-LAST:event_btnEmpreendimentoMouseClicked
    // Formulario de notas de compras
    private void jMenuItemNotaCompraActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItemNotaCompraActionPerformed
        try{
            FormNotaCompra form = new FormNotaCompra();
            form.setModal(true);
            form.setVisible(true);
            form.dispose();
        }
        catch(Exception ex){
            JOptionPane.showMessageDialog(this, ErrorMessage.MSG_GERAL_BANCO +
              "\n" + ErrorMessage.MSG_GERAL_LOG, "", JOptionPane.ERROR_MESSAGE);
        }
    }//GEN-LAST:event_jMenuItemNotaCompraActionPerformed
    // Formulario para finalizar empreendimento
    private void jMenuItemFinalizarEmpActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItemFinalizarEmpActionPerformed
        try{
            FormFinalizar form = new FormFinalizar();
            form.setModal(true);
            form.setVisible(true);
            form.dispose();
        }
        catch(Exception ex){
            JOptionPane.showMessageDialog(this, ErrorMessage.MSG_GERAL_BANCO +
              "\n" + ErrorMessage.MSG_GERAL_LOG, "", JOptionPane.ERROR_MESSAGE);
        }
    }//GEN-LAST:event_jMenuItemFinalizarEmpActionPerformed
    // Formulario para estornar movimento finalizado
    private void jMenuItemEstEmpActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItemEstEmpActionPerformed
        try{
            FormEstFinalizar form = new FormEstFinalizar();
            form.setModal(true);
            form.setVisible(true);
            form.dispose();
        }
        catch(Exception ex){
            JOptionPane.showMessageDialog(this, ErrorMessage.MSG_GERAL_BANCO +
              "\n" + ErrorMessage.MSG_GERAL_LOG, "", JOptionPane.ERROR_MESSAGE);
        }
    }//GEN-LAST:event_jMenuItemEstEmpActionPerformed
    // Formulario de relatorio de compras por fornecedor
    private void jMenuItemComFornActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItemComFornActionPerformed
        FormRelForn form = new FormRelForn();
        form.setModal(true);
        form.setVisible(true);
        form.dispose();
    }//GEN-LAST:event_jMenuItemComFornActionPerformed
    // Formulario de Divisao de Lucros
    private void jMenuItemVendasActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItemVendasActionPerformed
        try{
            FormVendas form = new FormVendas();
            form.setModal(true);
            form.setVisible(true);
            form.dispose();
        }
        catch(Exception ex){
            JOptionPane.showMessageDialog(this, ErrorMessage.MSG_GERAL_BANCO +
              "\n" + ErrorMessage.MSG_GERAL_LOG, "", JOptionPane.ERROR_MESSAGE);
        }
    }//GEN-LAST:event_jMenuItemVendasActionPerformed
    // Formulario para estornar movimento venda
    private void jMenuItemEstVendaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItemEstVendaActionPerformed
        try{
            FormEstornoVenda form = new FormEstornoVenda();
            form.setModal(true);
            form.setVisible(true);
            form.dispose();
        }
        catch(Exception ex){
            JOptionPane.showMessageDialog(this, ErrorMessage.MSG_GERAL_BANCO +
              "\n" + ErrorMessage.MSG_GERAL_LOG, "", JOptionPane.ERROR_MESSAGE);
        }
    }//GEN-LAST:event_jMenuItemEstVendaActionPerformed
    // Formulario de relatorio quantitativo por produto
    private void jMenuItemQtdeProdActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItemQtdeProdActionPerformed
        FormRelQuant form = new FormRelQuant();
        form.setModal(true);
        form.setVisible(true);
        form.dispose();
    }//GEN-LAST:event_jMenuItemQtdeProdActionPerformed
    // Formulario de relatorio de comparativo de precos
    private void jMenuItemCompProdActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItemCompProdActionPerformed
        FormRelComPrec form = new FormRelComPrec();
        form.setModal(true);
        form.setVisible(true);
        form.dispose();
    }//GEN-LAST:event_jMenuItemCompProdActionPerformed
    // Formulario de relatorio de divisao de lucros
    private void jMenuItemDivLucrosActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItemDivLucrosActionPerformed
        FormRelDivLucro form = new FormRelDivLucro();
        form.setModal(true);
        form.setVisible(true);
        form.dispose();
    }//GEN-LAST:event_jMenuItemDivLucrosActionPerformed

    private void jMenuSobreMousePressed(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jMenuSobreMousePressed
        FormSobre form = new FormSobre();
        form.setModal(true);
        form.setVisible(true);
    }//GEN-LAST:event_jMenuSobreMousePressed

    private void jMenuSairMousePressed(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jMenuSairMousePressed
        System.exit(0);
    }//GEN-LAST:event_jMenuSairMousePressed
    // Configuracao do Banco de Dados
    private void jMenuItemConfigBdActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItemConfigBdActionPerformed
        FormConfig form = new FormConfig();
        form.setModal(true);
        form.setVisible(true);
        form.dispose();
    }//GEN-LAST:event_jMenuItemConfigBdActionPerformed
    //</editor-fold>

    /**
    * @param args the command line arguments
    */
    public static void main(String args[]) {
        java.awt.EventQueue.invokeLater(new Runnable() {
            public void run() {
                new FormPrinc().setVisible(true);
            }
        });
    }

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton btnEmpreendimento;
    private javax.swing.JButton btnNotaCompra;
    private javax.swing.JButton btnNotaDespesa;
    private javax.swing.JButton btnOrcamento;
    private javax.swing.JButton btnProduto;
    private javax.swing.JMenu jMenuCadastros;
    private javax.swing.JMenuItem jMenuDespesa;
    private javax.swing.JMenu jMenuEstorno;
    private javax.swing.JMenuItem jMenuEtapas;
    private javax.swing.JMenuItem jMenuItemComForn;
    private javax.swing.JMenuItem jMenuItemCompProd;
    private javax.swing.JMenuItem jMenuItemConfigBd;
    private javax.swing.JMenuItem jMenuItemDespesa;
    private javax.swing.JMenuItem jMenuItemDivLucros;
    private javax.swing.JMenuItem jMenuItemEmp;
    private javax.swing.JMenuItem jMenuItemEstEmp;
    private javax.swing.JMenuItem jMenuItemEstVenda;
    private javax.swing.JMenuItem jMenuItemFinalizarEmp;
    private javax.swing.JMenuItem jMenuItemFornecedor;
    private javax.swing.JMenuItem jMenuItemGrupo;
    private javax.swing.JMenuItem jMenuItemInvEmp;
    private javax.swing.JMenuItem jMenuItemInvestidor;
    private javax.swing.JMenuItem jMenuItemNotaCompra;
    private javax.swing.JMenuItem jMenuItemOrcamento;
    private javax.swing.JMenuItem jMenuItemProduto;
    private javax.swing.JMenuItem jMenuItemQtdeProd;
    private javax.swing.JMenuItem jMenuItemRelEm;
    private javax.swing.JMenuItem jMenuItemUnidade;
    private javax.swing.JMenuItem jMenuItemVendas;
    private javax.swing.JMenu jMenuMovimentos;
    private javax.swing.JMenu jMenuNotas;
    private javax.swing.JMenuBar jMenuPrinc;
    private javax.swing.JMenu jMenuRelatorios;
    private javax.swing.JMenu jMenuSair;
    private javax.swing.JMenu jMenuSobre;
    private javax.swing.JMenu jMenuTabelas;
    private javax.swing.JMenu jMenuUtilitarios;
    private javax.swing.JPanel jPanelRodape;
    private javax.swing.JSeparator jSeparatorEstorno;
    private javax.swing.JSeparator jSeparatorGrupo;
    private javax.swing.JSeparator jSeparatorOrcamento;
    private javax.swing.JSeparator jSeparatorPessoas;
    private javax.swing.JSeparator jSeparatorProdutos;
    private javax.swing.JSeparator jSeparatorVendas;
    private javax.swing.JLabel lbData;
    private javax.swing.JToolBar toolBar;
    // End of variables declaration//GEN-END:variables

    //<editor-fold defaultstate="collapsed" desc="Methods">
    private void initializeThread(){
        ThreadShowDate tsd = new ThreadShowDate(lbData);
        
        Thread t = new Thread(tsd);
        t.start();
    }
    //</editor-fold>
}
